<%= form_for(@enrollment) do |f| %>
  <% if @enrollment.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@enrollment.errors.count, "error") %> prohibited this enrollment from being saved:</h2>

      <ul>
      <% @enrollment.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :actived %><br />
    <%= f.label "Sim" %> <%= radio_button(:enrollment, :actived , "S") %>
    <%= f.label "Não" %> <%= radio_button(:enrollment, :actived , "N") %>
  </div>
  <div class="field">
    <%= f.label :user %><br />
    <% options = User.find_all_by_type( "Student", :order => "name").collect {|student| [student.name,student.id]} %>
    <%= select(:enrollment, :user_id , options, :prompt => ">> Choose <<") %>
  </div>
  <div class="field">
    <%= f.label :course %><br />
    <% options = Course.all(:order => "name").collect {|course| [course.name,course.id]} %>
    <%= select(:enrollment, :course_id , options, :prompt => ">> Choose <<") %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
